//SPDX-FileCopyrightText: Copyright 2025-2025 深圳市同心圆网络有限公司
//SPDX-License-Identifier: GPL-3.0-only

import { invoke } from "@tauri-apps/api/core";

export type LlmProviderInfo = {
    provider_id: string;
    name: string;
    need_api_key: boolean;
    default_addr: string;
};

export type ListLlmProviderRequest = {};

export type ListLlmProviderResponse = {
    code: number;
    err_msg: string;
    provider_list: LlmProviderInfo[];
};

//列出大模型供应商
export async function list_llm_provider(request: ListLlmProviderRequest): Promise<ListLlmProviderResponse> {
    const cmd = 'ai_provider_api_cmds_list_llm_provider';
    console.log(`%c${cmd}`, 'color:#0f0;', request);
    return invoke<ListLlmProviderResponse>(cmd, {
        request,
    });
}